import upload from '@/utils/upload'

// 上传文件接口
export interface UploadResponse {
	code : number
	fileName : string
	info : {
		createBy : string
		createTime : string
		delFlag : number
		fileId : number
		fileName : string
		filePath : string
		fileSize : number
		fileType : string
		md5 : string
		remark : string
		storageType : string
		updateBy : string
		updateTime : string
	}
	msg : string
	url : string
}

// 统一上传接口
export function uploadFile(filePath : string, storageType : string = 'minio', clientName : string = 'MASTER') {
	return upload<UploadResponse>({
		url: `/file/${storageType}/${clientName}/upload`,
		filePath: filePath,
		name: 'file',
		formData: undefined
	})
}